extends layout

block content
  .row
    .col-12.col-md-8
      .card
        img.card-img-top(src=`/uploads/${diskfilename}`, alt=description)
        .card-body
          .d-flex.justify-content-between.align-items-center
            span 
              i.fa.fa-heart.mr-1
              = likes
            span= title
            button.btn.btn-primary#likes-btn(data-imageid=_id)
              i.fa.fa-heart-o.mr-1
              | 赞
      .list-group
        each comment in comments
          li.list-group-item
            p.text-left= comment.comment
            p.text-right= `${comment.nickname}(${comment.email})`

    .col-12.col-md-4
      .card.m-1
        h3.card-title 统计信息
        .card-body
          p.card-text 图片统计信息
  .row
    .col-12.col-md-8
      .card.m-1
        h3.card-title 用户评论
        .card-body
          form(action=`/comment/${_id}`, method="post")
            .form-group.row
              label.col-12.col-md-2(for="email") 邮箱
              input#email.col-12.col-md-10.form-control(type="email", name="email")
            .form-group.row
              label.col-12.col-md-2(for="nickname") 昵称
              input#nickname.col-12.col-md-10.form-control(type="text", name="nickname")
            .form-group.row
              label.col-12.col-md-2(for="comment") 评论
              textarea#comemnt.col-12.col-md-10.form-control(rows="5", name="comment")
            .for-group.row
              .col-4.offset-8
                button.btn.btn-primary.btn-block(type="submit") 保存
  script(src="/javascripts/show.js")     
